package com.UMLife.me.model;


public class LoginModel {
     String msg="";
     String  respone;   //从服务器返回的值，1或0
     private Communication c=new Communication();
    
     /*****
      * 登录,将账号和密码放在一个字符串msg传给服务器
      * @param cellpone
      * @param password
      * @return
      */
     public boolean login(String cellpone,String password)
     {  //TODO
    	msg=3+"|"+cellpone+"|"+password;
    	c=new Communication();
    	Thread thread=new Thread(c);
    	c.Setmsg(msg);
        c.SetNb(1);
    	thread.start();
    	try {
			thread.join();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	this.respone=c.Getrespone1();
    	 if(respone.equals("1"))
    	 {
    		 return true;
    	 }
    	 else return false;
    	
     }
}
    	 
